var required = '<span style="color:red;font-weight:bold" data-qtip="Required">*</span>';

Ext.define('AM.view.UserDetailForm',{
	extend:'Ext.form.Panel',
	alias:'widget.userdetailform',
	defaults:{
		//autoFitErrors : false,//展示错误信息时是否自动调整字段组件宽度  
        //labelSeparator :':',//分隔符  
        labelWidth : 30,//标签宽度  
        width : 300,//字段宽度  
        //allowBlank : false,//是否允许为空  
        //blankText : '不允许为空',  
        labelAlign : 'right',//标签对齐方式  
        //msgTarget :'qtip'          //显示一个浮动的提示信息  
        //msgTarget :'title'       //显示一个浏览器原始的浮动提示信息  
        //msgTarget :'under'       //在字段下方显示一个提示信息  
        msgTarget :'side'        //在字段的右边显示一个提示信息  
        //msgTarget :'none'        //不显示提示信息  
        //msgTarget :'errorMsg'    //在errorMsg元素内显示提示信息  
	},
	activeRecord:null,
	frame:true,
	title:'详细信息',
	collapsible:true,
	bodyPadding:'5 5 0',
	layout:{
		type:'vbox',
		align:'stretch'
	},
	items:[{
		xtype:'fieldcontainer',
		layout:'hbox',
		items:[{
			xtype:'textfield',
			name:'name',
	        fieldLabel:'姓名',//标签内容
	        afterLabelTextTpl:required,
	        labelWidth:50,
	        labelAlign:'right',
	        flex:1
		},{
			xtype:'numberfield',  
			name:'age',
	        fieldLabel:'年龄',//标签内容
	        afterLabelTextTpl:required,
	        labelWidth:50,
	        labelAlign:'right',
	        flex:1
	    },{
			xtype:'textfield',  
			name:'email',
	    	fieldLabel:'邮件',//标签内容
	        afterLabelTextTpl:required,
	        labelWidth:50,
	        labelAlign:'right',
	        flex:1
		}]
	},{
		xtype:'fieldcontainer',
		layout:'hbox',
		items:[{
			xtype:'numberfield',
			name:'money',
	    	fieldLabel:'金额',
	        labelWidth:50,
	        labelAlign:'right',
	       	flex:1
		},{
			xtype:'datefield',
			name:'birthday',
	    	fieldLabel:'生日',
	        labelWidth:50,
	        labelAlign:'right',
	        flex:1
		},{
			xtype:'textfield',
			name:'sex',
	    	fieldLabel:'性别',
	        labelWidth:50,
	        labelAlign:'right',
	        flex:1
		}]
	}],
	buttons:[{
		text:'保存',
		id:'save'
	},{
		text:'重置',
		id:'reset'
	}],
	setActiveRecord: function(record){
        this.activeRecord = record;
        if (record)
            this.getForm().loadRecord(record);
    }
});